#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>


int init_port(void)
{
	DDRC = 0xFF;
	DDRB = 0xFF;
	DDRA = 0xFF;
	PORTB = 0x00;
	PORTA = 0x00;
	PORTC = 0x00;

return 1;
}

int main (void) 
{

TCCR1B |= (1 << WGM12); // Configure timer 1 for CTC mode
TIMSK |= (1 << OCIE1A); // Enable CTC interrupt
sei(); // Enable global interrupts
OCR1A = 1562;//15625; // Set CTC compare value to 1Hz at 1MHz 
// AVR clock, with a prescaler of 64 
TCCR1B |= ((1 << CS10) | (1 << CS11)); // Start timer at // Fcpu/64 

if (!init_port())
	return 0;

for (;;) { 
		//PORTD=citeste_adc();
} 
}
 
 
 ISR(TIMER1_COMPA_vect) {
 
	
 
 }